<?php
/****************************************************************************

	COPYRIGHT(C) WWW.MAXSI.DK, MAXSI SOFTWARE, SORTIE 2009
	ALL RIGHTS RESERVED

	Maxsi Distribution ContentServer/ Branch
	Scripts running a Maxsi Distribution Compatible Content Server.	
	
	frontpage.php
	The frontpage for a maxsi compatible content server running the public/
	branch of the Maxsi Distribution Server System.

****************************************************************************/

if ( md_IsOutputHTML() )
{

?>

<p>

<b class="text_big">Maxsi Distribution Server</b><br />

This is a <a href="http://www.maxsi.dk/distribution/">Maxsi Distribution</a> Content Server.<br /><br />

</p>

<table>
<?php
}

mdc_SendVariableTextFull("Build",$md_CurrentVersion);
mdc_SendVariableTextFull("URL",md_GetContentServerURL());

$dns	=	dns_get_record($_SERVER['HTTP_HOST']);
$num	=	count($dns);
for ( $i = 0; $i < $num; $i++ )
{
	if ( $dns[$i]['type'] == 'A' )
	{
		mdc_SendVariableTextFull("IP",$dns[$i]['ip']);
	}
}


mdc_SendVariableTextFull("Admin",$md_adminname);
mdc_SendVariableTextFull("Admin Contact",$md_admincontact);
mdc_SendVariableTextFull("Database",($md_db) ? 'Yes' : 'No' );
mdc_SendVariableTextFull("Account System",($md_accountsys) ? 'Yes' : 'No' );
if ($md_accountsys)
{
	mdc_SendVariableTextFull("Session Id",$md_session);
	mdc_SendVariableTextFull("User Id",$md_account);
	if ( $md_account )
	{
		mdc_SendVariableTextFull("Username",$md_account_name);
		mdc_SendVariableTextFull("Logged in as Admin",($md_account_admin) ? 'Yes' : 'No' );			
	}
}

if ( $md_db )
{

	$slot	=	md_sql("SELECT name FROM ".md_GetDatabaseName('contentarchive')." ORDER BY name ASC");
	
	if ( $md_sql_total[$slot] )
	{
		for ( $i = 0; $i < $md_sql_total[$slot]; $i++)
		{
			mdc_SendVariableTextFull("Content Supported",$md_sql_row[$slot]['name']);
			
			md_sql_next($slot);
		}
	}
	else
	{
		mdc_SendVariableTextFull("Content Supported",'');
	}
	
	md_clearslot($slot);
}
else
{

	mdc_SendVariableTextFull("Content Supported",'');
}

if ( md_IsOutputHTML() )
{
?></table><?php
}

?>